<p-dialog [(visible)]="display" modal="modal"  [responsive]="true" [width]="width" (onHide)="closeInspectionTimeMask(false)" >
  <p-header>
    {{title}}
  </p-header>
  <div class="ui-g">
    <div class="ui-g-12">
      <div class="file-box" style="height: 300px">
        <form [formGroup]="inspectionTimeForm" >
          <div  formGroupName="timeGroup" class="ui-grid ui-grid-responsive ui-grid-pad ui-fluid" style="margin: 10px 0px" >
            <div class="ui-grid-row margin-bottom-1vw">
              <div class="ui-grid-col-2">
                <label >开始时间</label>
                <label ngClass="start_red">*</label>
              </div>
              <div class="ui-grid-col-8">
                <p-calendar [(ngModel)]="submitAddInspection.start_time" [showTime]="true" timeOnly="true" [showSeconds]="true" dataType="string"  *ngIf="state==='add'" formControlName="startTime"  ></p-calendar>
                <p-calendar [(ngModel)]="currentCycleTime.start_time" [showTime]="true" timeOnly="true" [showSeconds]="true" dataType="string"  *ngIf="state==='update'" formControlName="startTime" ></p-calendar>
              </div>
              <div class="ui-grid-col-2" [hidden]="inspectionTimeForm.get(['timeGroup','startTime']).valid||inspectionTimeForm.get(['timeGroup','startTime']).untouched">
                <div class="ui-message ui-messages-error ui-corner-all "  [hidden]="!inspectionTimeForm.hasError('required',['timeGroup','startTime'])">
                  <i class="fa fa-close"></i>
                  开始时间必填
                </div>
              </div>
            </div>

            <div></div>
            <div class="ui-grid-row margin-bottom-1vw">
              <div class="ui-grid-col-2">
                <label >结束时间</label>
                <label ngClass="start_red">*</label>
              </div>
              <div class="ui-grid-col-8">
                <p-calendar [(ngModel)]="submitAddInspection.end_time" [showTime]="true" timeOnly="true" [showSeconds]="true" dataType="string"   *ngIf="state==='add'" formControlName="endTime" ></p-calendar>
                <p-calendar [(ngModel)]="currentCycleTime.end_time" [showTime]="true" timeOnly="true" [showSeconds]="true" dataType="string"   *ngIf="state==='update'" formControlName="endTime" ></p-calendar>
              </div>
              <div class="ui-grid-col-2" [hidden]="inspectionTimeForm.get(['timeGroup','endTime']).valid||inspectionTimeForm.get(['timeGroup','endTime']).untouched">
                <div class="ui-message ui-messages-error ui-corner-all"  [hidden]="!inspectionTimeForm.hasError('required',['timeGroup','endTime'])" >
                  <i class="fa fa-close"></i>
                  结束时间必填
                </div>
              </div>
              <div class="ui-grid-col-2" class="ui-message ui-messages-error ui-corner-all"  *ngIf="inspectionTimeForm.hasError('time','timeGroup')" >
                <i class="fa fa-close"></i>
                {{inspectionTimeForm.getError('time','timeGroup')?.descxxx}}
              </div>
            </div>


          </div>

        </form>

      </div>
    </div>
  </div>
  <p-footer>
    <button type="button" pButton icon="fa-check" label="确定" (click)="formSubmit(false)" [disabled]="!inspectionTimeForm.valid"></button>
    <button type="button" pButton icon="fa-close"  label="取消" (click)="closeInspectionTimeMask(false)"></button>
  </p-footer>
</p-dialog>
